package com.smart.manager.work.entities.body;

import com.smart.common.entities.core.BaseSearch;
import com.smart.manager.product.entities.views.BasicPigstyView;
import com.smart.manager.product.entities.views.BasicRfidView;
import com.smart.manager.work.entities.enums.PigOrderKind;
import com.smart.manager.work.entities.enums.PigOrderStatus;
import com.smart.manager.work.entities.enums.StaffStatus;
import com.smart.manager.work.views.BasicStaffView;
import io.ebean.annotation.DbJson;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * 工单管理
 * @author leo
 * @date 2023/09/20
 */
public class RPigOrder {

    @Data
    @EqualsAndHashCode(callSuper = true)
    @ApiModel("RPigOrder1")
    public static class SearchBody extends BaseSearch {

        @ApiModelProperty("工单编号")
        private String code;

        @ApiModelProperty("管家信息")
        private String staff;

        @ApiModelProperty("订单状态")
        private PigOrderStatus status;

        @ApiModelProperty("订单类型")
        private PigOrderKind kind;

    }


    @Data
    @ApiModel("RPigOrder2")
    public static class EditBody  implements Serializable {

        @ApiModelProperty("工单编号")
        private String code;

        @ApiModelProperty("管家信息")
        private BasicStaffView staff;

        @ApiModelProperty("订单状态")
        private PigOrderStatus status;

        @ApiModelProperty("订单类型")
        private PigOrderKind kind;

        @ApiModelProperty("是否加急")
        private Boolean anxious;

        @ApiModelProperty("订单内容")
        @DbJson
        private Object content;

        @ApiModelProperty("完成时间")
        private LocalDateTime completeTime;

        @ApiModelProperty("显示排序")
        private Integer sort;
    }


    @Data
    @ApiModel("RPigOrder2")
    public static class enterTheCircleBody  implements Serializable {

        @ApiModelProperty("猪仔id")
        @NotNull(message = "猪仔id 不能为空")
        private Long id;

        @ApiModelProperty("猪仔编码")
        @NotBlank(message = "猪仔编码 不能为空")
        private String code;

        @ApiModelProperty("猪仔天数")
        @NotNull(message = "猪仔天数 不能为空")
        private Integer day;

        @ApiModelProperty("耳标MAC")
        @NotNull(message = "耳标MAC 不能为空")
        private BasicRfidView rfid;

        @ApiModelProperty("所属猪圈")
        @NotNull(message = "猪仔id 不能为空")
        private BasicPigstyView pigsty;

        @ApiModelProperty("入栏日龄")
        private Integer enterAge;
    }


}
